cmake_minimum_required(VERSION 2.6)
PROJECT(exec)

SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)


SET(CMAKE_C_FLAGS_RELEASE "-O3 -ffast-math -std=gnu99 -Wall")
SET(CMAKE_C_FLAGS_DEBUG "-g -O3 -ffast-math -std=gnu99 -Wall")
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ../lib/dombuilder)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build)
LINK_DIRECTORIES(../lib/tinyxml ../lib/sadom ../lib/sa2d ../lib/chipmunk)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/tinyxml ../dom ../SA2D)

SET(Headers
DomBuilder.h
)
SET(Sources
DomBuilder.cpp
)

SET(Libraries
sadom
tinyxml
)
set_source_files_properties(${Sources} PROPERTIES LANGUAGE CXX)
set_source_files_properties(${Headers} PROPERTIES LANGUAGE CXX)

#ADD_EXECUTABLE(domTest 
# main.cpp
# ${Headers}
# ${Sources}
#)
#TARGET_LINK_LIBRARIES(domTest ${Libraries})

ADD_EXECUTABLE(simulator
 sa2dRunner.cpp
 ${Headers}
 ${Sources}
)
TARGET_LINK_LIBRARIES(simulator sadom sa2d tinyxml chipmunk glut)